//
//  DYAddEmployeeVC.m
//  kafuMerchant
//
//  Created by 帝云科技 on 2018/9/18.
//  Copyright © 2018年 帝云科技. All rights reserved.
//

#import "DYAddEmployeeVC.h"
#import "DYAddBranchShopCell.h"

@interface DYAddEmployeeVC ()

@property (nonatomic,strong)NSArray *titleArray;
@property (nonatomic,strong)NSArray *palceholderArray;

@property (nonatomic,strong)UIButton *submitButton;

@end

@implementation DYAddEmployeeVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title=@"新增员工";
    
}
-(void)dy_initData
{
    [super dy_initData];
    
    self.titleArray=@[@"员工名",@"登录名",@"登录密码",@"确认密码",@"权限组"];
    self.palceholderArray=@[@"请输入员工名",@"请输入员工手机号",@"请设置登录密码",@"请再次输入登录密码",@"请选择员工所属权限"];
}
-(void)dy_initUI
{
    [super dy_initUI];
    
    self.tableView.backgroundColor=WhiteColor;
    
    [self.tableView registerClass:[DYAddBranchShopCell class] forCellReuseIdentifier:@"DYAddBranchShopCell"];
    
    [self.tableView addSubview:self.submitButton];
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 5;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return BILIHEIGHT(58);
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    DYAddBranchShopCell *cell=[tableView dequeueReusableCellWithIdentifier:@"DYAddBranchShopCell" forIndexPath:indexPath];
    
    cell.titleLabel.text=self.titleArray[indexPath.row];
    cell.textField.placeholder=self.palceholderArray[indexPath.row];
    [cell.textField setValue:[UIColor xhq_assist] forKeyPath:@"_placeholderLabel.textColor"];
    if (indexPath.row==4) {
        cell.arrowImageView.hidden=NO;
        cell.textField.enabled=NO;
    }else{
        cell.arrowImageView.hidden=YES;
        cell.textField.enabled=YES;
        if (indexPath.row==1) {
            [cell.textField setNumbersKeyboard];
        }
    }
    return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row==4) {
        XHQHUDTEXT(@"选择员工权限");
    }
}
#pragma mark - 确认提交
-(void)submitButtonClick
{
    
}
-(UIButton *)submitButton
{
    if (!_submitButton) {
        _submitButton=[Utils createBtnWithType:UIButtonTypeCustom backgroundColor:[UIColor xhq_base] action:@selector(submitButtonClick) target:self title:@"确认提交" image:@"icon_login" font:17 textColor:WhiteColor];
        _submitButton.frame=CGRectMake(kScreenWidth-BILIWIDTH(142), BILIHEIGHT(58*5)+BILIHEIGHT(30), BILIWIDTH(132), BILIHEIGHT(38));
        [_submitButton placeImageTitlePosition: ZYButtonImagePositionRight space:BILIWIDTH(10)];
        [_submitButton xhq_cornerRadius:BILIHEIGHT(19)];
    }
    return _submitButton;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
